/*
**Michael Lowe
**ECE 373_Spring 2012
**04/21/12
**
**Assignment 4: PCI Driver
*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <string.h>

int main()
{

	int fd = 0;
	char * messageBuff;
	int temp = 0;

	messageBuff = (char * ) malloc(sizeof(char)*14);
	//open pci driver for Read or Write
//	fd = open("/dev/labjack1portA",O_RDWR);
	
//	sleep(2);
//	read(fd,messageBuff,14);
//	fd = open("/dev/labjack1portB",O_RDWR);
//	sleep(2);
//	printf("Message %s",messageBuff);
	
	fd = open("/dev/labjack1portC",O_RDWR);
	sleep(2);
	read(fd,&temp,14);

	printf("Temperature %d\n",temp);

	close(fd);
}
